import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom';
import About from './About';
import Home from './Home';
import Other from './Other';

ReactDOM.render(
  <Router>
    <App>
      <Switch>
        <Route path="/" exact component={Home} />
        <Route path="/about" component={About} />
        <Route path="/other/:id" component={Other} />
        <Redirect to="/" />
      </Switch>
    </App>
  </Router>
  , document.getElementById('root'));
registerServiceWorker();
